package com.sunzm.flink.datastream.scala.sink

import org.apache.flink.streaming.api.scala.StreamExecutionEnvironment
import org.slf4j.{Logger, LoggerFactory}

/**
 *
 * ScalaSinkDemo
 *
 * @author Administrator
 * @version 1.0
 * @date 2021-06-22 20:48
 */
object ScalaSinkDemo {
  private val logger: Logger = LoggerFactory.getLogger(this.getClass.getName.stripSuffix("$"))
  private val isLocal = true

  def main(args: Array[String]): Unit = {

    //1.创建执行的环境
    val env: StreamExecutionEnvironment = if (isLocal) {
      StreamExecutionEnvironment.createLocalEnvironmentWithWebUI()
    } else {
      StreamExecutionEnvironment.getExecutionEnvironment
    }

    //5.执行
    env.execute(this.getClass.getSimpleName.stripSuffix("$"))
  }
}
